﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
using ShopayServer.Http;

namespace ShopayServer.Controller
{
    public class Base
    {
        public static Response Message(Response response, string message, JToken data = null)
        {
            return response.json(new JObject {
                {"error", 0},
                {"message", message},
                {"data", data}
            });
        }

        public static Response Error(Response response, string message)
        {
            return response.json(new JObject {
                {"error", 1},
                {"message", message}
            });
        }
    }
}
